﻿using System;
using UnityEngine;
using AForgeFramework;
using UnityEngine;

namespace AforgeFramework
{
    public class TestClass
    {
        private RNA _rna;

        public TestClass()
        {
           
         
        }

        public void TrainNetwork()
        {
            double[][] entrada = new double[5][];
            double[][] saida = new double[5][];

            //Life - Time
            //entrada[0] = new double[2]; entrada[0][0] = 100; entrada[0][1] = 4;
            //entrada[1] = new double[2]; entrada[1][0] = 100; entrada[1][1] = 7;
            //entrada[2] = new double[2]; entrada[2][0] = 80; entrada[2][1] = 7;
            //entrada[3] = new double[2]; entrada[3][0] = 50; entrada[3][1] = 15;
            //entrada[4] = new double[2]; entrada[4][0] = 30; entrada[4][1] = 20;

            entrada[0] = new double[1]; entrada[0][0] = 4;
            entrada[1] = new double[1]; entrada[1][0] = 7; 
            entrada[2] = new double[1]; entrada[2][0] = 8; 
            entrada[3] = new double[1]; entrada[3][0] = 12; 
            entrada[4] = new double[1]; entrada[4][0] = 30; 

            saida[0] = new double[1]; saida[0][0] = 10;
            saida[1] = new double[1]; saida[1][0] = 8;
            saida[2] = new double[1]; saida[2][0] = 7;
            saida[3] = new double[1]; saida[3][0] = 6;
            saida[4] = new double[1]; saida[4][0] = 5;

            _rna = new RNA(entrada, saida, 1, 20, 10, 1);

            _rna.TrainNetWork();
        }

        public double Recognize(double[] values)
        {
            return _rna.Recognize(values);
        }
    }
}
